source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!

platform :ios, '13.0'
inhibit_all_warnings!

target 'XLog_Example' do
  pod 'XLog', :path => '../'

  target 'XLog_Tests' do
    inherit! :search_paths

    pod 'Quick', '~> 6.0'  # https://github.com/Quick/Quick
    pod 'Nimble', '~> 11.0'  # https://github.com/Quick/Nimble
#    pod 'RxAtomic', :modular_headers => true
    pod 'RxBlocking'  # https://github.com/ReactiveX/RxSwift
  end
end

post_install do |installer|
    # Cocoapods optimization, always clean project after pod updating
    Dir.glob(installer.sandbox.target_support_files_root + "Pods-*/*.sh").each do |script|
        flag_name = File.basename(script, ".sh") + "-Installation-Flag"
        folder = "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
        file = File.join(folder, flag_name)
        content = File.read(script)
        content.gsub!(/set -e/, "set -e\nKG_FILE=\"#{file}\"\nif [ -f \"$KG_FILE\" ]; then exit 0; fi\nmkdir -p \"#{folder}\"\ntouch \"$KG_FILE\"")
        File.write(script, content)
    end
    
    # Enable tracing resources
    installer.pods_project.targets.each do |target|
      if target.name == 'RxSwift'
        target.build_configurations.each do |config|
          if config.name == 'Debug'
            config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['-D', 'TRACE_RESOURCES']
          end
        end
      end
    end
    
    # To hide deployment target warnings
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
      end
    end
end
